#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QPainter>
QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
    void InitUI();
    void connectSignaleAndSlots();
    QJsonArray randomPiction();


protected:
    // 重写鼠标事件 -- 由于默认情况下，Qt 的窗口只有在标题栏才能拖动, 因此当采用无边框栏需要重写
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    // 记录光标与窗口标题栏的相对距离
    QPoint dragPosition;
    bool isDragging;

private slots:
    void on_quit_clicked();

    void InitLovePlay();
    void on_playLove_clicked();
    void toggleLove(); // 快捷键
    void onBtFormClick(int id);

private:
    Ui::Widget *ui;
};
#endif // WIDGET_H
